import Mock from "mockjs";
const Random = Mock.Random;
Mock.Random.extend({
    drugType(){
        var list=[1001,1002,1003]
        return this.pick(list);
    },
    unit(){
        var list=[8001,8002,8003,8004,8005]
        return this.pick(list);
    }
})
// mock挑战赛-用户关系对象
export const mockDrug = function () {
  let list = [];

  for (let i = 0; i < Random.integer(5, 11); i++) {
    const object = Mock.mock({ 
        "id|1-100": 1,
        name: "药品" + "@natural(1,100)",
        specification: '@word(5)',
        manufacturer: "@word(10)",
        usageDosage: "@word(10)",
        unit: '@unit',
        price: '@float(100,1000,2,2)',
        drugType: '@drugType',
        inventory: '@natural(100,10000)',
        deleted: false,
        gmtCreate: "@date(yyyy-MM-dd hh:mm:ss)",
        gmtModify: "@date(yyyy-MM-dd hh:mm:ss)",
    });
    list.push(object);
  }

  return {
    result: list,
    statusCode: 'C200',
    msgId: "获取药品列表成功！",
  };
};